package com.xuxueli.applyModules.utils;
import org.springframework.security.crypto.bcrypt.BCryptPasswordEncoder;

/**
 * 加密处理
 */
public class MD5Utils {

     private static BCryptPasswordEncoder bcryptPasswordEncoder = new BCryptPasswordEncoder();
    public static String encrypt(String pswd) {
        String hashPass = bcryptPasswordEncoder.encode(pswd);
        return hashPass;
    }

    public static Boolean deencrypt(String account,String hashPass) {
        Boolean flag = false;
        try {
            flag = bcryptPasswordEncoder.matches(account,hashPass);
        }catch (Exception ex){
            flag = false;
        }
        return flag;
    }

}
